<%@ page language="java" import="java.util.*,cn.biwysh.exam.entity.Notice" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

Notice notice=new Notice();
notice.setContent("");
notice.setType(1);
notice.setTitle("该通告已被删除");
if(request.getAttribute("notice")!=null){
	notice=(Notice)request.getAttribute("notice");
}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title><%=notice.getTitle() %></title>
    <link href="css/qt/tgdetail.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="script/jquery/jquery-1.5.1.min.js"></script>
    <script type="text/javascript" src="script/jquery/jquery.elastic.source.js"></script>
    <script type="text/javascript">
    $(function() {
       initImg();
       initZYbg();
   	    $(window).resize(function() {
		    initZYbg();
		   });
	    });
 function initZYbg(){ 
	//alert($(document).width());
       if(document.body.clientWidth<957){
	        $("#mainleft").width(0);
	        $("#mainright").width(0);
	        $("#mainleft").css("display","none");
		    $("#mainright").css("display","none");
        }else{
	       if(!window.ActiveXObject){
		        var wid=($(document).width()-953)/2;
		        $("#mainleft").width(wid);
		        $("#mainright").width(wid);
		        $("#mainleft").css("display","block");
		        $("#mainright").css("display","block");
		    }else{
		        var wid=($(document).width()-974)/2;
		        if(wid>0){
		        	$("#mainleft").width(wid);
			        $("#mainright").width(wid);
			        $("#mainleft").css("display","block");
			        $("#mainright").css("display","block");
		        }
		    }
        }
}
function initImg(){
	if(!window.ActiveXObject){
        $("#textcontest").elastic();
        $("#textcontest").trigger('update');

        <%if(notice.getType()==2){%>
	        $("#simg").load(function(){
	    		var dheight=$("#simg").height()+$("#textcontest").height();
	            if(dheight>580){
	            	$("#mainbg").css("height",(150+dheight)+"px");
	            	$("#tgTXT").css("height",(160+dheight)+"px");
	             }
	    	});
	    <%}else{ %>
		    var dheight=$("#textcontest").height();
	        if(dheight>500){
	        	$("#mainbg").css("height",(150+dheight)+"px");
	        	$("#tgTXT").css("height",(160+dheight)+"px");
	         }
	    <%}%>
        $("#footht").css("height","20px");
    	
      }else{
    	  <%if(notice.getType()==2){ %>
            var imgwidth=0,imgheight=0;
	        var imginfo="";
		    imginfo="<%=notice.getImgurl()%>".substring("<%=notice.getImgurl()%>".lastIndexOf("_")+1,"<%=notice.getImgurl()%>".lastIndexOf("&"));
			imgwidth=Number(imginfo.split("@")[0]);
			imgheight=Number(imginfo.split("@")[1]);
		    //如果是ie的话，每次预览要初始化图片的宽高
		    var widthlst=0,heightlst=0;
			if(imgwidth>680){
				heightlst=parseInt(680*imgheight/imgwidth);
				widthlst=680;
			}else{
				widthlst=imgwidth;
				heightlst=imgheight;
			}
			$("#simg").css("width",widthlst+"px");
			$("#simg").css("height",heightlst+"px");
	    <%} %>
    }
}
    </script>
  </head>
  
  <body>
    <div id="mainleft"><img src="img/qt/mainleft.jpg" style="width:100%;height:100%;"/></div>
     <div id="main">
      <div id="top">
           <jsp:include page="stitle.jsp" flush="true"></jsp:include>
           <div class="sign clear">
              <div class="signzuo"></div>   
              <div class="signzhong">
                <div class="signshow">电力通告</div>
              </div>   
              <div class="signyou"></div>   
           </div>
       </div>
       <div id="tgTXT">
           <div id="mainbg">
              <div style="height: 18px;"></div>
				<div id="stitle"><%=notice.getTitle() %></div>
				<div style="height: 15px;border-bottom:dotted 1px #9E9E9E;width:90%;margin:0 auto;"></div>
				<div style="height: 15px;"></div>
				<div style="text-align:center;font-weight:bolder;font-size: 11px;"><%=notice.getAddtimestr() %></div>
				<div style="height: 15px;"></div>
				<%if(notice.getType()==2){%>
					<img id="simg" src="upload/tonggao/<%=notice.getImgurl()%>" />
					<div style="height: 20px;"></div>
				<%}else{ %>
				    <img id="simg" style="display: none;" />
				<%}%>
				<div id="scontest">
					<textarea id="textcontest" readonly="readonly"
						style="border: solid 0px red; width: 75%; height: 20px; background-color: transparent; overflow: visible;font-size: 12px;line-height: 25px;"><%=notice.getContent() %></textarea>
				</div>
				<div style="height: 30px;"></div>
           </div>
           <div id="mainbottom"></div>
       </div>
      <div style="height: 10px;"></div>
      <div id="footer">
		  <jsp:include page="footer.jsp" flush="true"></jsp:include>
	   </div>
     </div>
     <div id="mainright"><img src="img/qt/mainright.jpg" style="width:100%;height:100%;"/></div>
  </body>
</html>
